<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTitleInfoTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('title_info', function (Blueprint $table) {
            $table->bigInteger('id', true);
            $table->bigInteger('data_version_id')->nullable()->comment('数据版本id');
            $table->bigInteger('user_id')->nullable();
            $table->string('tea_title', 255)->nullable()->comment('教师职称');
            $table->dateTime('tea_gain_time')->nullable()->comment('教师职称获得时间');
            $table->string('tea_title_rank', 255)->nullable()->comment('教师岗位等级');
            $table->dateTime('tea_employ_time')->nullable()->comment('教师聘任日期');
            $table->string('manage_title', 255)->nullable()->comment('管理岗位职称');
            $table->dateTime('manage_gain_time')->nullable()->comment('管理职称获得时间');
            $table->string('manage_title_rank', 255)->nullable()->comment('管理岗位等级');
            $table->dateTime('manage_employ_time')->nullable()->comment('管理岗位聘任日期');
            $table->bigInteger('form_instance_id')->nullable()->comment('表单实例id');
            $table->integer('deleted')->nullable()->default(0);
            $table->bigInteger('creator_id')->nullable()->default(0);
            $table->bigInteger('updater_id')->nullable()->default(0);
            $table->dateTime('created_at')->nullable()->useCurrent();
            $table->dateTime('updated_at')->nullable()->useCurrent();
            $table->string('modified_column', 255)->nullable()->comment('被修改过的字段');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('title_info');
    }
};
